<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统- 后台管理</title>
<link href="<%=basePath%>/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>/js/jquery/jquery-1.7.1.js"></script>
<script type="text/javascript"	src="<%=basePath%>/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript">
function reApplay(codeId){
	 $.ajax({
		  type: 'POST',
		  url: "<%=basePath%>/reApplay.do?passCode.codeId="+codeId,
		  success: function(data){
			   alert(data); 
		  },
		  dataType:'json'
		});
}
function reSendSms(codeId){
	 $.ajax({
		  type: 'POST',
		  url: "<%=basePath%>/reSendSms.do?passCode.codeId="+codeId,
		  success: function(data){
			   alert(data); 
		  },
		  dataType:'json'
		});
}
function viewPassPort(codeId){
	parent.openWin("<%=basePath%>/viewPassPort.do?passCode.codeId="+codeId,800,200,'通关信息','通关信息','二维码通关信息');
}
function goToPage(curPage){
	$("#queryPageCurPage").val(curPage);
	$("#passCodeQueryForm").submit();
}
</script>

</head>
<body>
<table width="100%" border="0" cellspacing="6" cellpadding="0" style="border-collapse: separate; border-spacing: 6px;">
	<tr valign="top">
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0"
				class="blockTable">
				 <form id="passCodeQueryForm"  name="passCodeQueryForm" action="${pageContext.request.contextPath}/passCodeList.do" method="post" target="consoleFrame" >
				 <input name="queryPage.curPage" id="queryPageCurPage" type="hidden" value="${queryPage.curPage}"/>
				<tr>
					<td style="padding:2px 10px;">
				
						<div style="float: left;">
						<font color="red">今天 -昨天 -最近7天-最近30天  </font>
								游玩日期:&nbsp;<input name="passCode.startDate" id="startDate" value="<fmt:formatDate value="${passCode.startDate}" type="both" pattern="yyyy-MM-dd"/>"  type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>&nbsp;
								至:&nbsp;<input name="passCode.endDate" id="endDate" value="<fmt:formatDate value="${passCode.endDate}" type="both" pattern="yyyy-MM-dd"/>" type="text"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>&nbsp;
								&nbsp;游客手机: 
							<input name="passCode.mobile" type="text" value="${passCode.mobile}" id="passCode.mobile"/> 
							&nbsp;订单号: 
							<input name="passCode.orderId" type="text" value="${passCode.orderId}"id="passCode.orderId"/> 
							
						</div>
				
					 </td>
				</tr>
				<tr>
					<td style="padding:10px 10px;">
				
						<div style="float: left;">
								申请流水号:&nbsp;<input name="passCode.serialNo" value="${passCode.serialNo}"  type="text"/>&nbsp;
								申请状态：
								<select name="passCode.status">
								  <option value="">请选择</option>
								  <option value="FAILED">申请失败</option>
								  <option value="SUCCESS">申请成功</option>
								  <option value="NOHANDL">未处理</option>
								</select>
								<input id="Submitbutton" type="submit" value="查询" />
						</div>
				
					 </td>
				</tr>
				</form>
				<tr>
					<td style="padding-top:2px;padding-left:6px;padding-right:6px;padding-bottom:2px;">
						<table width="100%" cellpadding="2" cellspacing="0" class="dataTable">
							<tr ztype="head" class="dataTableHead">
								<td width="5%"><strong>流水号</strong></td>
								<td width="5%"><strong>订单号</strong></td>
								<td width="10%"><strong>二维码</strong></td>
								<td width="7%"><strong>辅助码</strong></td>
								<td width="7%"><strong>游客姓名</strong></td>
								<td width="7%"><strong>游客手机</strong></td>
								<td width="5%"><strong>状态</strong></td>
								<td width="7%"><strong>创建时间</strong></td>
								<td width="15%"><strong>操作</strong></td>
							</tr>
							
							<c:forEach items="${passCodeList}" var="p">
								<tr>
									<td>${p.serialNo}</td>
									<td>${p.orderId}</td>
									<td>${p.code}</td>
									<td>${p.addCode}</td>
									<td><font color ='red'>游客姓名</font></td>
									<td>${p.mobile}</td>
									<td>${p.status}</td>
									<td><fmt:formatDate value="${p.createTime}" type="both" pattern="yyyy-MM-dd"/></td>
									<td>
										<a href='javascript:void(0);' ztype='zPushBtn' class='zPushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnAdd' onClick="reApplay('${p.codeId}');return false;" priv="article_modify">
											 <b>重新申请</b>
										</a>
										<a href='<%=basePath%>/destroy.do?passCode.codeId=${p.codeId}' ztype='zPushBtn' class='zPushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnAdd' priv="article_modify">
											 <b>作废</b>
										</a>
										<a href='javascript:void(0);' ztype='zPushBtn' class='zPushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnAdd' onClick="reSendSms('${p.codeId}');return false;" priv="article_modify">
											 <b>重发短信</b>
										</a>
										<a href='javascript:void(0);' ztype='zPushBtn' class='zPushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnAdd' onClick="viewPassPort('${p.codeId}');return false;" priv="article_modify">
											 <b>查看通关信息</b>
										</a>
										<a href='<%=basePath%>/onApplay.do?passCode.codeId=${p.codeId}' target="consoleFrame" ztype='zPushBtn' class='zPushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnAdd'  priv="article_modify">
											 <b>测试申请</b>
										</a>
										<a href='<%=basePath%>/onApplay.do?passCode.codeId=${p.codeId}' target="consoleFrame" ztype='zPushBtn' class='zPushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnAdd'  priv="article_modify">
											 <b><font color ='green'>点击模拟游玩</font></b>
										</a>
										
									</td>
								</tr>			
							</c:forEach>
							<tr>
							<td colspan="8" align="left">
								<div style='float:right;font-family:Tahoma'>
									<a href="javascript:goToPage('1');">第一页</a>
										&nbsp;
									<c:if test="${((queryPage.curPage) > 1)}">
									|&nbsp;<a href="javascript:goToPage('${(queryPage.curPage-1)}');">上一页</a>
									&nbsp;|
									</c:if>&nbsp;
									<c:if test="${queryPage.curPage< queryPage.pageCount}">
										<a href="javascript:goToPage('${(queryPage.curPage+1)}');">下一页</a>&nbsp;|&nbsp;<a href="javascript:goToPage('${(queryPage.pageCount)}');">最末页</a>
									</c:if>
									&nbsp;&nbsp;
									转到第&nbsp;<input id="gotopage" type='text' class='inputText' style='width:40px' onKeyUp="value=value.replace(/\D/g,'')">&nbsp;页&nbsp;&nbsp;<input type='button' onclick="if(!/^\d+$/.test($('#gotopage').val())){alert('错误的页码');$('#gotopage').focus();}else{goToPage($('#gotopage').val());}" class='inputButton' value='跳转'>
								</div>
								<div style='float:left;font-family:Tahoma'>共 ${(queryPage.totalItem)} 条记录，每页  ${(queryPage.pageSize)} 条，当前第  ${(queryPage.curPage)} / ${(queryPage.pageCount)} 页</div>
							</td>
							</tr>	
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>
